package com.ithei.date.mydate;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class 时间格式转换1 {
    public static void main(String[] args) throws ParseException {
        String birthday="";
        SimpleDateFormat sdf1=new SimpleDateFormat("yyyy-MM-dd");
        String agee=String.valueOf(new Date().getYear()-sdf1.parse(birthday).getYear());
        Scanner sc=new Scanner(System.in);
        SimpleDateFormat sdf=new SimpleDateFormat("yy年MM月dd日");
        String ss=sdf.format(new Date());
        System.out.println(ss);
        Date date1= sdf.parse(ss);
        System.out.println(" - - - - - - - - - - ");
        System.out.println("请输入你的生日年份:");
        String year=sc.nextLine();
        System.out.println("请输入你的生日月份:");
        String month=sc.nextLine();
        System.out.println("请输入你的生日当月天数:");
        String day=sc.nextLine();
        String  s=year+"年"+month+"月"+day+"日";
        long l1=sdf.parse(s).getTime();
        Date date=new Date();
        long count=(date.getTime()-l1)/(1000L*60*60*24);
        System.out.println(count);


    }
}
